﻿//======================================================================
//
//        Copyright (C) 2002-2008 S.Sams Lifexperience!
//        All rights reserved
//        FileName : PageBase
//        Description :
//        Created by Sam Shen at 2008/9/8 19:20:44
//        http://lab.travelive.com.cn/
//        E-Mail: S.Sams@msn.com
//
//======================================================================

using System;
using System.Collections.Generic;
using System.Text;

namespace S.Sams.GoogleMap
{
    /// <summary>
    /// 被继承的地图页面基类, 生成地图激活脚本
    /// </summary>
    public class MapPageBase : System.Web.UI.Page
    {
        /// <summary>
        /// 处理激活脚本
        /// </summary>
        /// <param name="e"></param>
        protected override void  OnInit(EventArgs e)
        {
 	        base.OnInit(e);
            //string ScriptTag = "<script type=\"text/javascript\">" + new JavaScriptPack.ECMAScriptPacker(JavaScriptPack.ECMAScriptPacker.PackerEncoding.Normal, true, false).Pack("if(document.all){window.attachEvent(\"onload\",function(){initialize()});window.attachEvent(\"onunload\",function(){GUnload();})}else{window.addEventListener(\"load\", function(){initialize();},false);window.addEventListener(\"unload\", function(){GUnload();},false);}") + "</script>";

            string ScriptTag = "<script type=\"text/javascript\">eval(function(p,a,c,k,e,d){e=function(c){return(c<a?\"\":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p;}('9(8.a){1.4(\"7\",0(){3()});1.4(\"d\",0(){5()})}e{1.6(\"b\",0(){3()},2);1.6(\"c\",0(){5()},2)}',15,15,'function|window|false|initialize|attachEvent|GUnload|addEventListener|onload|document|if|all|load|unload|onunload|else'.split('|'),0,{}))</script>";

            ClientScript.RegisterStartupScript(GetType(), "bodyevent", ScriptTag);
        }
    }
}
